﻿#include "CmdSaveLineChartMainSettingData.h"
#include <QFile>
#include <QDebug>
#include "BaseModule/IBaseSignal.h"
#include "PostCommandPy.h"

namespace PostCommand
{
    CmdSaveLineChartMainSettingData::CmdSaveLineChartMainSettingData()
        : CommandBase()
    {
        this->initCmdName();
    }
    CmdSaveLineChartMainSettingData::~CmdSaveLineChartMainSettingData()
    {
    }

    bool CmdSaveLineChartMainSettingData::execute()
    {
        // bool _success = false;
        emit IBaseSignalInstance->signal_saveLineChartMainSettingData(
            m_mainWindowId,
            m_index,
            m_axiDisIsAutoName,
            m_axiDisTitleText,
            m_axiDisTitleFontColorStr,
            m_axiDisTitleFontSize,
            m_axiDisAxisColorStr,
            m_axiDisAxisThickness,
            m_axiDisValuePrecision,
            m_axiDisAxisDigitColorStr,
            m_axiDisAxisDigitSize,
            m_axiRangIsAutoRange,
            m_axiRangMaxValue,
            m_axiRangMinValue,
            m_axiRangIsAutoStepSize,
            m_axiRangCustomStepSize,
            m_yAxiDisIsAutoName,
            m_yAxiDisTitleText,
            m_yAxiDisTitleFontColorStr,
            m_yAxiDisTitleFontSize,
            m_yAxiDisAxisColorStr,
            m_yAxiDisAxisThickness,
            m_yAxiDisValuePrecision,
            m_yAxiDisAxisDigitColorStr,
            m_yAxiDisAxisDigitSize,
            m_yAxiRangIsAutoRange,
            m_yAxiRangMaxValue,
            m_yAxiRangMinValue,
            m_yAxiRangIsAutoStepSize,
            m_yAxiRangCustomStepSize,
            m_gridIsMainGridLineDisplay,
            m_gridMainGridLineColorStr,
            m_gridMainGridLineStyle,
            m_gridMainGridLineThickness,
            m_gridIsSecondaryGridLineDisplay,
            m_gridSecondaryGridLineColorStr,
            m_gridSecondaryGridLineStyle,
            m_gridSecondaryGridLineThickness,
            m_titleName,
            m_titleFontColorStr,
            m_titleFontSize,
            m_legendFontColorStr,
            m_legendFontSize,
            m_legendLineColorStr,
            m_legendLineThickness,
            m_resultDataName,
            m_dataLineColorStr,
            m_dataLineStyle,
            m_dataLineThickness,
            m_isDisplaySymbol,
            m_symbolStyle,
            m_symbolSize,
            m_symbolColorStr);
        return true;
    }

    void CmdSaveLineChartMainSettingData::undo()
    {
    }

    void CmdSaveLineChartMainSettingData::redo()
    {
        // execute();
    }

    void CmdSaveLineChartMainSettingData::setLineChartMainSettingData(int mainWindowId, int index, bool axiDisIsAutoName, QString axiDisTitleText, QString axiDisTitleFontColorStr, int axiDisTitleFontSize, QString axiDisAxisColorStr, int axiDisAxisThickness, double axiDisValuePrecision, QString axiDisAxisDigitColorStr, int axiDisAxisDigitSize,
                                                                      bool axiRangIsAutoRange, double axiRangMaxValue, double axiRangMinValue, bool axiRangIsAutoStepSize, double axiRangCustomStepSize,
                                                                      bool yAxiDisIsAutoName, QString yAxiDisTitleText, QString yAxiDisTitleFontColorStr, int yAxiDisTitleFontSize, QString yAxiDisAxisColorStr, int yAxiDisAxisThickness, double yAxiDisValuePrecision, QString yAxiDisAxisDigitColorStr, int yAxiDisAxisDigitSize,
                                                                      bool yAxiRangIsAutoRange, double yAxiRangMaxValue, double yAxiRangMinValue, bool yAxiRangIsAutoStepSize, double yAxiRangCustomStepSize,
                                                                      bool gridIsMainGridLineDisplay, QString gridMainGridLineColorStr, int gridMainGridLineStyle, double gridMainGridLineThickness, bool gridIsSecondaryGridLineDisplay, QString gridSecondaryGridLineColorStr, int gridSecondaryGridLineStyle, double gridSecondaryGridLineThickness,
                                                                      QString titleName, QString titleFontColorStr, int titleFontSize,
                                                                      QString legendFontColorStr, int legendFontSize, QString legendLineColorStr, int legendLineThickness,
                                                                      QString resultDataName, QString dataLineColorStr, int dataLineStyle, double dataLineThickness, bool isDisplaySymbol, int symbolStyle, double symbolSize, QString symbolColorStr)
    {
        m_mainWindowId = mainWindowId;
        m_index = index;
        m_axiDisIsAutoName = axiDisIsAutoName;
        m_axiDisTitleText = axiDisTitleText;
        m_axiDisTitleFontColorStr = axiDisTitleFontColorStr;
        m_axiDisTitleFontSize = axiDisTitleFontSize;
        m_axiDisAxisColorStr = axiDisAxisColorStr;
        m_axiDisAxisThickness = axiDisAxisThickness;
        m_axiDisValuePrecision = axiDisValuePrecision;
        m_axiDisAxisDigitColorStr = axiDisAxisDigitColorStr;
        m_axiDisAxisDigitSize = axiDisAxisDigitSize;
        m_axiRangIsAutoRange = axiRangIsAutoRange;
        m_axiRangMaxValue = axiRangMaxValue;
        m_axiRangMinValue = axiRangMinValue;
        m_axiRangIsAutoStepSize = axiRangIsAutoStepSize;
        m_axiRangCustomStepSize = axiRangCustomStepSize;
        m_yAxiDisIsAutoName = yAxiDisIsAutoName;
        m_yAxiDisTitleText = yAxiDisTitleText;
        m_yAxiDisTitleFontColorStr = yAxiDisTitleFontColorStr;
        m_yAxiDisTitleFontSize = yAxiDisTitleFontSize;
        m_yAxiDisAxisColorStr = yAxiDisAxisColorStr;
        m_yAxiDisAxisThickness = yAxiDisAxisThickness;
        m_yAxiDisValuePrecision = yAxiDisValuePrecision;
        m_yAxiDisAxisDigitColorStr = yAxiDisAxisDigitColorStr;
        m_yAxiDisAxisDigitSize = yAxiDisAxisDigitSize;
        m_yAxiRangIsAutoRange = yAxiRangIsAutoRange;
        m_yAxiRangMaxValue = yAxiRangMaxValue;
        m_yAxiRangMinValue = yAxiRangMinValue;
        m_yAxiRangIsAutoStepSize = yAxiRangIsAutoStepSize;
        m_yAxiRangCustomStepSize = yAxiRangCustomStepSize;
        m_gridIsMainGridLineDisplay = gridIsMainGridLineDisplay;
        m_gridMainGridLineColorStr = gridMainGridLineColorStr;
        m_gridMainGridLineStyle = gridMainGridLineStyle;
        m_gridMainGridLineThickness = gridMainGridLineThickness;
        m_gridIsSecondaryGridLineDisplay = gridIsSecondaryGridLineDisplay;
        m_gridSecondaryGridLineColorStr = gridSecondaryGridLineColorStr;
        m_gridSecondaryGridLineStyle = gridSecondaryGridLineStyle;
        m_gridSecondaryGridLineThickness = gridSecondaryGridLineThickness;
        m_titleName = titleName;
        m_titleFontColorStr = titleFontColorStr;
        m_titleFontSize = titleFontSize;
        m_legendFontColorStr = legendFontColorStr;
        m_legendFontSize = legendFontSize;
        m_legendLineColorStr = legendLineColorStr;
        m_legendLineThickness = legendLineThickness;
        m_resultDataName = resultDataName;
        m_dataLineColorStr = dataLineColorStr;
        m_dataLineStyle = dataLineStyle;
        m_dataLineThickness = dataLineThickness;
        m_isDisplaySymbol = isDisplaySymbol;
        m_symbolStyle = symbolStyle;
        m_symbolSize = symbolSize;
        m_symbolColorStr = symbolColorStr;
    }

} // namespace PostCommand
